
#ifndef __SEGMENT_H
#define __SEGMENT_H

#include "dictionary/dict.h"
#include "pat_array.h"
#include "sentence.h"


class Segment
{
private:
	Dictionary *dict;
	PatArray *patArray;
	
	wchar_t * document;
	
	wchar_t * document2;

	Sentence *head;
	Sentence *tail;

public:

	Segment();
	~Segment();

	bool analysisFile(const char * path);
	void analysisDocument(wchar_t * document);
	void split(wchar_t * senten);
	void info();
	
	
private:
	void output_result(wchar_t * begin, wchar_t *end);
	void output_result_reverse(wchar_t * begin, wchar_t *end);

	void addSentence(wchar_t *senten, bool needSplit,int size);
	void splitIntoSentences();
	void segmentSentences();
	void segmentSentence(Sentence * se);
	
};

bool isChinese(wchar_t* t);

#endif